package com.ikun.controller;

import com.ikun.pojo.Result;
import com.ikun.service.DishesService;
import com.ikun.service.impl.DishesServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/dishes")
public class DishesController {
    @Autowired
    DishesService dishesService;
    //根据商家id查询该商家的菜品
    @GetMapping("/getDishesByBusinessId/{businessId}")
    // ThePathVariable annotation is used to bind the value of the URI template variable to a method parameter
    public Result getDishesByBusinessId(@PathVariable Integer businessId){
        // TODO: Implement the logic to fetch dishes based on businessId
        // For demonstration purposes, we'll return a sample result
        return Result.success(dishesService.getDishesByBusinessId(businessId));
    }

}
